package Basic.day03;

public class OperDemo05 {
    public static void main(String[] args) {
        //字符串拼接运算符
        System.out.println("hello" + "world");
        System.out.println("hello" + 10);
        System.out.println(10 + "hello" + "world");
        System.out.println(10 + "hello" + 20);
        System.out.println(10 + 20 + "hello" + "world");
        System.out.println("hello" + (10 + 20));
        System.out.println("hello" + 10 * 20);
        System.out.println("hello" + 10 / 2);
        System.out.println("hello" + 10 % 2);
        System.out.println("hello" + true);
        System.out.println("hello" + false);
        System.out.println("hello" + 'a');
        System.out.println("hello" + '1');
        System.out.println("hello" + '中');
        System.out.println("hello" + 'a' + 'b' + '中');
        System.out.println("hello" + 'a' + "b" + '中');
        System.out.println("hello" + 'a' + (10 + 20));
        System.out.println("hello" + (10 + 20) + 'a');
        System.out.println("hello" + (10 + 'a'));//先做运算，再做拼接
        System.out.println("hello" + (10 + 'a') + 'b');

        System.out.println("----------------------");
        //自动类型提升
        char c1 = 'a';
        int a = c1;
        System.out.println(a);
    }
}
